<!--
- @founder   IT柏拉图, https: //weibo.com/itprato
- @author    DedeCMS团队
- @copyright Copyright (c) 2007 - 2021, 上海卓卓网络科技有限公司 (DesDev, Inc.)
--->

<html>
<head>
<meta charset="{dede:global.cfg_soft_lang/}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>修改内容类型</title>
<meta name="copyright" content="2007-2021 DedeCMS, 上海卓卓网络科技有限公司 (DesDev, Inc.)" />
<link rel="icon" href="/favicon.ico" />
<!-- CSS FILES -->
<link rel="stylesheet" type="text/css" href="{dede:global.cfg_assets_dir/}/pkg/uikit/css/uikit.min.css" />
<link rel="stylesheet" type="text/css" href="{dede:global.cfg_assets_dir/}/css/manage.dede.css">
<style type="text/css">
.uk-table td{
padding: 6px 12px;
vertical-align: top;
height: 35px;
}
</style>
</head>
<body>
<!-- 列表头部 -->
<div id="Table_Header_202X2W2X1X292F" class="uk-card uk-card-small uk-card-default" uk-sticky="bottom: #offset">
<div id="Header_1W2T2S2T1V252B" class="uk-card-header">
<div class="uk-grid uk-grid-small uk-text-small">
<span><ul class="uk-breadcrumb"><li><a href="mychannel_main.php">内容类型管理</a> </li><li><span>修改内容类型</span></li></ul></span>
</div>
</div>
</div>
<!-- /列表头部 -->
<!-- 列表主体 -->
<div class="uk-card uk-card-small uk-card-default" style="top:-20px;margin-bottom: 50px;">
<div class="uk-card-body uk-overflow-auto" grid>
<div class="uk-child-width-1-1 uk-padding">
<form name="form1" action="mychannel_edit.php" method="post">
<input type='hidden' name='id' value='<?php echo $id?>'>
<input type='hidden' name='dopost' value='save'>
<input type='hidden' name='issystem' value='<?php echo $row['issystem']; ?>'>
<!-- 选项 -->
<ul uk-tab>
<li><a href="#">基本设置</a></li>
<li><a href="#">字段管理</a></li>
</ul>
<ul class="uk-switcher uk-margin">
<li>
<table width="98%" border="0" cellpadding="1" cellspacing="1" class="uk-table">
<?php
if($row['issystem'] == 1)
{
?>
<tr>
<td colspan="2" style="color:red"> 您目前所展开的是系统模型，系统模型一般对发布程序和管理程序已经固化，如果您胡乱修改系统模型将会导致使用这种内容类型的频道可能崩溃。 </td>
</tr>
<?php
}
?>
<tr>
<td><b>模型性质</b><br />
<span id="help5">如果为<u>系统模型</u>将禁止删除，此选项不可修改，对于独立模型，系统强制创建字段aid、栏目ID、发布时间、文档标题。</span></td>
<td>
<?php
if($row['issystem']==0) echo "自动模型";
else if($row['issystem']==1) echo "系统模型";
else if($row['issystem']==-1) echo "独立模型";
?>
</td>
</tr>
<tr>
<td width="35%"><b>频道ID</b><br />
<span id='help1'>数字，创建后不可修改，并具有唯一性。</span></td>
<td width="65%">
<?php echo $row['id']; ?> </td>
</tr>
<tr>
<td><b>名字标识</b><br />
<span id="help2">与文档的模板相关连，建议由英文、数字或下划线组成，因为部份Unix系统无法识别中文文件，频道默认文档模板是 “default/article_名字标识.htm”，列表模板、封面模板类推。 </span></td>
<td>
<?php echo $row['nid']; ?> </td>
</tr>
<tr>
<td><b>频道名称</b><br />
<span id="help3">频道的中文名称，在后台管理，前台发布等均使用此名字。</span></td>
<td><input name="typename" type="text" class="uk-input uk-form-small uk-form-width-large" id="typename" value="<?php echo $row['typename']; ?>" /></td>
</tr>
<tr>
<td><b>附加表</b><br />
<span id="help4">频道除主表以外其它自定义类型数据存放数据的表，如果您不使用主表关连的各种特性(推荐、会员权限等)，也可以使用完全以附加表作为存储数据。</span></td>
<td><input name="addtable" type="text" class="uk-input uk-form-small uk-form-width-large" id="addtable" value="<?php echo $row['addtable']; ?>" />
( #@__ 是表示数据表前缀)</td>
</tr>
<tr>
<td><strong>是否支持会员投稿</strong></td>
<td>
<input name="issend" type="radio" class="uk-radio" value="0"<?php if($row['issend']==0) echo " checked='1' "; ?> />
不支持 &nbsp;&nbsp;
<input type="radio" class="uk-radio" name="issend" value="1"<?php if($row['issend']==1) echo " checked='1' "; ?> />
支持 </td>
</tr>
<tr>
<td><strong>会员许可投稿级别</strong></td>
<td>
<select name="sendrank" id="sendrank" class="uk-select uk-form-small uk-form-width-medium">
<option value='0'>游客</option>
<?php
$urank = $cuserLogin->getUserRank();
$dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank' And rank>=10");
$dsql->Execute();
while($row2 = $dsql->GetObject())
{
if($row2->rank==$row['sendrank']) echo " <option value='".$row2->rank."' selected>".$row2->membername."</option>\r\n";
else echo " <option value='".$row2->rank."'>".$row2->membername."</option>\r\n";
}
?>
</select> </td>
</tr>
<tr>
<td><strong>许可投稿会员组</strong></td>
<td>
<?php
$dsql->SetQuery("Select * from `#@__member_model`");
$dsql->Execute();
while($row3 = $dsql->GetObject())
{
echo "<input name='usertype' class='uk-radio' type='radio' value=".$row3->name." /> ".$row3->name." &nbsp;&nbsp;\r\n";
}
?>
<input name="usertype" type="radio" class="uk-radio" value=""<?php if($row['usertype']=='') echo " checked='1' ";?> />
不限 </td>
</tr>
<tr>
<td><strong>会员稿件默认状态</strong></td>
<td>
<input name="arcsta" type="radio" class="uk-radio" value="-1"<?php if($row['arcsta']==-1) echo " checked='1' ";?>>
未审核 &nbsp;&nbsp;
<input name="arcsta" type="radio" class="uk-radio" value="0"<?php if($row['arcsta']==0) echo " checked='1' ";?>>
已审核（自动生成HTML）&nbsp;&nbsp;
<input name="arcsta" type="radio" class="uk-radio" value="1"<?php if($row['arcsta']==1) echo " checked='1' ";?>>
已审核（仅使用动态文档）</td>
</tr>
<tr>
<td><strong>档案发布程序</strong></td>
<td><input name="addcon" type="text" class="uk-input uk-form-small uk-form-width-large" id="addcon" value="<?php echo $row['addcon']; ?>" /></td>
</tr>
<tr>
<td><strong>档案修改程序</strong></td>
<td><input name="editcon" type="text" class="uk-input uk-form-small uk-form-width-large" id="editcon" value="<?php echo $row['editcon']; ?>" /></td>
</tr>
<tr>
<td><strong>档案管理程序</strong></td>
<td><input name="mancon" type="text" class="uk-input uk-form-small uk-form-width-large" id="mancon" value="<?php echo $row['mancon']; ?>" /></td>
</tr>
<tr>
<td><strong>前台会员发布程序</strong></td>
<td><input name="useraddcon" type="text" class="uk-input uk-form-small uk-form-width-large" id="useraddcon" value="<?php echo $row['useraddcon']; ?>" /></td>
</tr>
<tr>
<td><strong>前台会员修改程序</strong></td>
<td><input name="usereditcon" type="text" class="uk-input uk-form-small uk-form-width-large" id="usereditcon" value="<?php echo $row['usereditcon']; ?>" /></td>
</tr>
<tr>
<td><strong>前台会员管理程序</strong></td>
<td><input name="usermancon" type="text" class="uk-input uk-form-small uk-form-width-large" id="usermancon" value="<?php echo $row['usermancon']; ?>" /></td>
</tr>
<tr>
<td><strong>列表附加字段</strong><br />
<span id="help6">用&quot;,&quot;分开，可以在列表模板{ dede:list}{/dede:list}中用[field:name /]调用</span></td>
<td>
<input name="listfields" type="text" class="uk-input uk-form-small uk-form-width-large" id="listfields" size="50" value="<?php echo $row['listfields']; ?>" style="width:80%;" /> </td>
</tr>
<tr>
<td><b>投稿标题使用名称</b></td>
<td>
<input name="titlename" type="text" class="uk-input uk-form-small uk-form-width-large" id="titlename" value="<?php echo $row['titlename']; ?>" /> </td>
</tr>
<tr>
<td>
<strong>投稿是否使用摘要</strong>
<br/>
<span>如果不使用主表(独立模型)，缩略图设置同。</span>
</td>
<td>
<input name="needdes" type="radio" class="uk-radio" value="1"<?php if($row['needdes']==1) echo " checked='1'"; ?> />
使用 &nbsp;&nbsp;
<input name="needdes" type="radio" class="uk-radio" value="0"<?php if($row['needdes']==0) echo " checked='1'"; ?> />
不使用 </td>
</tr>
<tr>
<td><strong>投稿是否使用缩图</strong></td>
<td>
<input name="needpic" type="radio" class="uk-radio" value="1"<?php if($row['needpic']==1) echo " checked='1'"; ?> />
使用 &nbsp;&nbsp;
<input name="needpic" type="radio" class="uk-radio" value="0"<?php if($row['needpic']==0) echo " checked='1'"; ?> />
不使用 </td>
</tr>
<tr>
<td><b>默认栏目ID</b><br />
<span id="help8">与投稿是唯一性结合可以用模型设计自定义表单</span> </td>
<td>
<input name="dfcid" type="text" class="uk-input uk-form-small uk-form-width-large" id="dfcid" value="<?php echo $row['dfcid']; ?>" style="width:80px" /></td>
</tr>
<tr>
<td><b>投稿具有唯一性</b><br />
<span id="help9">如果投稿是唯一的(会员只能在这个模型对应的栏目中发布单篇文档)，其作用相当于自定义表单</span> </td>
<td>
<input name="onlyone" type="radio" class="uk-radio" value="1" <?php if($row['onlyone']==1) echo " checked='1'"; ?> />
是 &nbsp;&nbsp;
<input name="onlyone" type="radio" class="uk-radio" value="0" <?php if($row['onlyone']==0) echo " checked='1'"; ?> />
不是 </td>
</tr>
</table>
</li>
<li>
<table width="98%" border="0" cellpadding="1" cellspacing="1" class="uk-table">
<tr>
<td height="28"><strong>模型字段配置(可视化模式)</strong></td>
<td style="text-align:right;">
<a href="mychannel_field_add.php?id=<?php echo $id; ?>" class="uk-button uk-button-default uk-button-small">添加新字段</a>
</td>
</tr>
<tr>
<td colspan='2' style="padding:6px">
<table class="uk-table uk-table-striped">
<thead>
<tr>
<td width="28%">表单提示文字</td>
<td width="18%">数据字段名</td>
<td width="20%">数据类型</td>
<td width="18%">表单类型</td>
<td>维护</td>
</tr>
</thead>
<?php
if($row['issystem']==-1)
{
?>
<tr>
<td colspan='5'>aid 和 typeid 是强制使用字段，这里不列出。</td>
</tr>
<?php
}
else
{
?>
<tr>
<td colspan='5'>下面列出的字段是附加表的字段，除此外，它还包含主表dede_archives的所有字段</td>
</tr>
<?php
}
$ds = file(DEDEADMIN."/inc/fieldtype.txt");
foreach($ds as $d){
$dds = explode(',',trim($d));
$fieldtypes[$dds[0]] = $dds[1];
}
$fieldset = $row['fieldset'];
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
if(is_array($dtp->CTags)){
foreach($dtp->CTags as $ctag)
{
?> <tr>
<td>
<?php
$itname = $ctag->GetAtt('itemname');
if($itname=='') echo "没指定";
else echo $itname;
?> </td>
<td>
<?php echo $ctag->GetTagName(); ?> </td>
<td>
<?php
$ft = $ctag->GetAtt('type');
if(isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
else echo "系统专用类型";
?> </td>
<td>
<?php
$ft = $ctag->GetAtt('autofield');
if($ft=='' || $ft==0) {
echo "固化字段";
}
else {
echo "自动表单";
}
?>
</td>
<td>
<?php
if($ft==1)
{
?>
<a href='mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&issystem=<?php echo $row['issystem']; ?>'>[修改]</a>
<?php if($row['issystem']!=1){ ?>
<a href='#' onClick='javascript:DelNote("mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&action=delete");'>[删除]</a>
<?php } ?>
<?php
}
else
{
echo "禁止修改";
}
?>
</td>
</tr>
<?php
}}
?>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<strong>模型字段配置(文本模式) </strong><br />
修改配置文本可调整字段顺序，但不会修改字段属性！<br />
<textarea name="fieldset" style="width:98%;height:300px" rows="10" id="fieldset" class="uk-textarea uk-form-small"><?php echo $row['fieldset']; ?></textarea>
</td>
</tr>
</table>
</li>
</ul>
<!-- /选项 -->
</div>
</div>
<div class="uk-card-footer " >
<div class="uk-padding-small" >
<button type="submit" class="uk-button uk-button-small uk-button-primary">提交</button>
</div>
</div>
</div>
</form>
<!-- 列表底部 -->
<div class="bar-bottom uk-flex uk-light uk-flex-right">
<div class="uk-button-group" style="margin-left: 50px;">
</div>
<div class="e1e02">Copyright &copy; 2007-2021 <a href='http://www.dedecms.com' target='_blank'><u>DedeCMS</u></a>, 上海卓卓网络科技有限公司 (DesDev, Inc.)</div>
</div>
<!-- 列表底部 -->
<!-- JS FILES -->
<script src="{dede:global.cfg_assets_dir/}/pkg/uikit/js/uikit.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/pkg/uikit/js/uikit-icons.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/pkg/jquery/jquery.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/js/dede.manage.min.js"></script>
<script language="javascript">
function Nav() {
if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
else return "OT";
}
function $Obj(objname) {
return document.getElementById(objname);
}
function ShowHide2(objname) {
var obj = $Obj(objname);
if(obj.style.display != 'block'){ obj.style.display = 'block' }
else{ obj.style.display = 'none'; }
}
//删除
function DelNote(gourl) {
if(!window.confirm("你确认要删除这个字段么！")){ return false; }
location.href=gourl;
}
function ShowObj(objname) {
var obj = document.getElementById(objname);
if(Nav()=='IE') {obj.style.display = "block";obj.style.display = "block";}
else obj.style.display = "table";
}
function HideObj(objname) {
var obj = document.getElementById(objname);
obj.style.display = "none";
}
function ShowItem1() {
ShowObj('head1'); ShowObj('needset');
HideObj('head2'); HideObj('adset');
}
function ShowItem2() {
ShowObj('head2'); ShowObj('adset');
HideObj('head1'); HideObj('needset');
}
</script>
<!-- / JS FILES -->
</body>
</html>
